﻿@model IEnumerable<CloudFranceTriple.Models.UserProfile>

@{
    ViewBag.Title = String.Format("{0} - {1}", CloudFranceTriple.WebRole.Properties.Resources.RoleUsersTitle, ViewBag.RoleName);
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="content-padding">
    <h1>@CloudFranceTriple.WebRole.Properties.Resources.RoleUsersTitle - @ViewBag.RoleName</h1>
    <section>
        <table>
            <tr>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginUserName
                </th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterEmail
                </th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterLastRequestDate
                </th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterShowInNonAdminList
                </th>
                <th></th>
            </tr>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.UserName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Email)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.LastRequestDate)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.ShowInNonAdminList)
                    </td>
                    <td>
                        @Html.ActionLink(@CloudFranceTriple.WebRole.Properties.Resources.UserRolesButtonUnlink, "Unlink", "RoleUsers", new { id = item.UserId as int? as int?, id2 = ViewBag.RoleId, area = "UserManager" }, null)
                    </td>
                </tr>
            }

        </table>
    </section>
    @{if (ViewBag.ShowLinkUser)
      {
        <section>
            @using (Html.BeginForm())
            {
                @Html.ValidationSummary(true)
                <fieldset>
                    <legend>User</legend>

                    <div class="editor-field">
                        @Html.DropDownList("User_Id", String.Empty)
                        <input type="submit" value="@CloudFranceTriple.WebRole.Properties.Resources.UserRolesButtonLink" />
                    </div>
                </fieldset>
            }
        </section>
      }
    }
    <br />
    @Html.Partial("_RoleBackToList")
</div>
